<%--
    Document   : listfood
    Created on : Nov 11, 2011, 9:09:31 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.NgonNgu, Beans.NhanVien,Beans.ThamSoHT,Models.ThamSoHT_Model"%>
<%
            NhanVien nv = new NhanVien();
            if (session.getAttribute("nv") == null) {
                response.sendRedirect("index.jsp");
            } else {
                nv = (NhanVien) session.getAttribute("nv");
                if (nv == null || nv.getMaNNV() != 1) {
                    response.sendRedirect("index.jsp");
                }
            }
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../css/style.css" type="text/css" rel="stylesheet" />
        <link href="../css/jquery.alerts.css" type="text/css" rel="stylesheet" />

        <link type="text/css" href="../css/ui-darkness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />

        <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
        <script src="../js/fileuploader.js" type="text/javascript"></script>
        <script src="../js/jquery.alerts.js" type="text/javascript"></script>
        <script src="../js/msg.js" type="text/javascript"></script>
        <script src="../js/ajax.js" type="text/javascript"></script>
        <title>JSP Page</title>
        <script type="text/javascript">

            $().ready(function() {
                $(".toggle").click(function(){
                    $(".content").slideToggle("medium");
                });
                $('dd:not(:first)').hide();
                $('dt a').click(function(){
                    $('dd:visible').slideUp('medium');
                    $('dt.current').removeClass('current');
                    if($(this).parent().next().is(':hidden')==true){
                        $(this).parent().addClass('current').next().slideDown('medium');
                    }
                });
                $('#sidebar ul li a').click(function(){
                    $('#sidebar li.current').removeClass('current');
                    $(this).parent().addClass('current');
                });




            });
        </script>
    </head>
    <%
                int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
                String dsts = " 'abbreviation', 'description', 'foodgroups', 'foodname', 'image', 'newfood', 'price', 'status', 'area', 'currency', 'food', 'historysystem', 'signout', 'table', 'unit', 'user'  ";
                ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

                String abbreviation = mdsts[0].getTenTS();
                String area = mdsts[1].getTenTS();
                String currency = mdsts[2].getTenTS();
                String food = mdsts[3].getTenTS();
                String foodgroups = mdsts[4].getTenTS();
                String foodname = mdsts[5].getTenTS();
                String historysystem = mdsts[6].getTenTS();
                String image = mdsts[7].getTenTS();
                String newfood = mdsts[8].getTenTS();
                String price = mdsts[9].getTenTS();
                String signout = mdsts[10].getTenTS();
                String status = mdsts[11].getTenTS();
                String table = mdsts[12].getTenTS();
                String unit = mdsts[13].getTenTS();
                String user = mdsts[14].getTenTS();
                String description = mdsts[14].getTenTS();                
                Vector vDSNMA = (Vector) session.getAttribute("DSNMA");
                int MaMA = (Integer) session.getAttribute("MaMA");
                
                

    %>

    <body>
        <div id="head">
            <div class="left">
                <a class="button profile" href="">
                    <img style=" margin-top: 4px;" alt="" src="../images/huser.png">
                </a>
                Hi,
                <a href="#"><%=nv.getHoTen()%></a>
                |
                <a href="../DangNhap_Controller?action=logout"><%=signout%></a>
            </div>
            <div class="right">
                <form id="search" class="search placeholder" action="#">
                    <label>Looking for something ?</label>
                    <input class="text" type="text" name="q" value="">
                    <input class="submit" type="submit" value="rechercher">
                </form>
            </div>
        </div>
        <div id="sidebar">
            <dl>
                <dt class="nosubmenu"><a href="#"><img alt="" src="../images/inbox.png">Dashboard</a></dt>
                <dt class="current"><a href="#"><img alt="" src="../images/layout.png">Elements</a></dt>
                <dd>
                    <ul>
                        <li>
                            <a href="#" class="1" onclick="NewArea(this.className);"><%=area%></a>
                        </li>
                        <li>
                            <a href="#" class="1" onclick="NewTable( this.className);"><%=table%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" onclick="History( this.className);"><%=historysystem%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" onclick="User( this.className);"><%=user%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" onclick="Foodgroups( this.className);"><%=foodgroups%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" onclick="Unit( this.className);"><%=unit%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" onclick="Currency( this.className);"><%=currency%></a>
                        </li>
                        <li>
                            <a href="../MonAn_Controller?action=Show"  class="1" ><%=food%></a>
                        </li>
                        <li>
                            <a href="?p=calendar">Calendar</a>
                        </li>
                    </ul>
                </dd>
                <dt><a href="#"><img alt="" src="../images/brush.png">Another submenu</a></dt>
                <dd>
                    <ul>
                        <li>
                            <a href="#">Fake menu #1</a>
                        </li>
                        <li>
                            <a href="#">Fake menu #2</a>
                        </li>
                        <li>
                            <a href="#">Fake menu #3</a>
                        </li>
                    </ul>
                </dd>
                <dt><a href="#"><img alt="" src="../images/brush.png">Infinite sublevel</a></dt>
                <dd>
                    <ul>
                        <li>
                            <a href="#">Fake menu #1</a>
                        </li>
                        <li>
                            <a href="#">Fake menu #2</a>
                        </li>
                        <li>
                            <a href="#">Fake menu #3</a>
                            <ul>
                                <li>
                                    <a href="#">Fake menu #1</a>
                                </li>
                                <li>
                                    <a href="#">Fake menu #2</a>
                                </li>
                                <li>
                                    <a href="#">Fake menu #3</a>
                                    <ul>
                                        <li>
                                            <a href="#">Fake menu #1</a>
                                        </li>
                                        <li>
                                            <a href="#">Fake menu #2</a>
                                        </li>
                                        <li>
                                            <a href="#">Fake menu #3</a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </dd>
                <dt class="nosubmenu"><a href="#"><img alt="" src="../images/lab.png">This button is useless</a></dt>
                <dt class="nosubmenu"><a href="#"><img alt="" src="../images/comment.png">Modal box</a></dt>
            </dl>
        </div>
        <div id="content" class="white">
<h1>
    <img alt="" src="../images/area.png"><%=newfood%>
</h1>
<div class="bloc" style="  ">
    <div class="title">
        
    </div>
    <div class="content">
        <form name="addFood" id="newHotnessForm" action="/playground/ajax_upload" enctype="multipart/form-data" method="post">
            <div style=" float: left; width: 63%;">
            <div style="width: 110px; float: left; margin-left: 5px; "><label><%=foodgroups %></label></div>
            <select name="nhommonan" style=" width: 180px; margin-bottom: 11px;">
                <%
                            for (int k = 0; k < vDSNMA.size(); k++) {
                                Beans.NhomMA nma = (Beans.NhomMA) vDSNMA.elementAt(k);
                %>       <option value="<%=nma.getMaNMA()%>"><%=nma.getTenNMA()%></option>
                <%  }
                %>
            </select><br />
            <div style="width: 110px; float: left; margin-left: 5px; "><label><%=foodname %></label></div>
            <input type="text"  style=" width: 180px; margin-bottom: 11px;" class="text" name="tenmonan"/><br />
            <div style="width: 110px; float: left; margin-left: 5px; "><label><%=abbreviation %></label></div>
            <input type="text" style=" width: 180px; margin-bottom: 11px;" class="text" name="tenviettat"/><br />
            <div style="width: 110px; float: left; margin-left: 5px; "><label><%=description %></label></div>
            <textarea class="textarea" style=" margin-bottom: 11px;" cols="22" rows="2" name="mota"></textarea><br />
            <div style="width: 110px; float: left; margin-left: 5px; "><label><%=image %></label></div>
            <div id="uniform-file" class="uploader">
                <input id="imageUpload" type="file" size="15" name="Image" id="Image" style="opacity: 0; ">
                <span class="filename" style="-moz-user-select: none; margin-top: -24px; color: #131313; max-width: 180px;">No file selected</span>
                <span class="action" style="-moz-user-select: none;">Choose File</span>
            </div><br />
            <input type="submit" class="button" style=" margin-left: 115px; margin-top: 10px; margin-bottom: 5px;" value="save">
            </div>


            <table style=" width: 37%;" >
                <thead>
                    <tr>
                        <th style="width: 35%; border: none; background: none; padding-bottom: 10px;"><%=unit %></th>
                        <th style="width: 50%; border: none; background: none; padding-bottom: 10px;"><%=price %></th>
                    </tr>
                </thead>
                <tbody id="dvt">
                    <tr>
                        <td style="border: none; background: none;">
                            <input type="text" style=" width: 100px; margin-bottom: 11px;" class="text" name="donvitinh"/>
                        </td>
                        <td style="border: none; background: none;">
                            <input type="text" style=" width: 100px; margin-bottom: 11px;" onkeypress="return keypress(event)" class="text" name="gia"/>
                            <a href="#" style=" margin-left: 15px;" onclick="Addmoredvt()">Add more</a>
                        </td>
                    </tr>
                </tbody>
            </table>



        </form>

    </div>
</div>

<div id="foodlang" style=" width: 49%; overflow: hidden; " >
</div>
        </div>

    </body>
</html>






